Teacher Version
Obstacle Detection Failures
Topics Covered
- Switch Loops
Virtual Robot: ObstacleDetectAttemptsVR.rbg
Physical Robot: ObstacleDetectAttempts.rbg
Check Your Understanding
- Why doesn't this program work for Obstacle Detection?
- The Forward command should not be set to 50% power
- The forward command block has control, and prevents the program from checking sensors or running other blocks until the forward command finishes counting 4 rotations
- The program should use the Gyro sensor instead of the Distance sensor
- The Forward command should be set to 6 rotations instead of 4
- True or False: The repeatUntil block simultaneously and continuouslychecks the left motor rotations, while the blocks inside hold the program flow.
- True
- False
- Why doesn’t this program work for Obstacle Detection?
- The repeatUntil Loop block does not check the correct sensor
- You cannot have two waitUntil commands in sequence that way
- The first waitUntil block should be 'Distance Value greater than 100' and the second waitUntil block should be 'Distance Value less than 100'
- The waitUntil blocks prevent program flow from reaching the end of the Loop to check the Motor Encoder
- Instead of using a Waiting approach or long movements, the solution you will learn in the next section will involve:
- Continuous checking of sensors
- Sensor recombination forks
- A new multiple-sensor Wait block
- A new type of Loop block